
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="lib/daterangepicker/daterangepicker.css" /> 

<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>商品评价</title>
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> <a _href="welcome.html" class="fun-toindex" href="javascript:;">首页</a> <span class="c-gray en">&gt;</span> 商品评价管理 <span class="c-gray en">&gt;</span> 商品评价列表 <a class="btn btn-success radius r mr-20 reload" style="line-height:1.6em;margin-top:3px" href="javascript:;" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
	<span class="r" style="margin-top: -2px; box-sizing: border-box;">
		

		
		
		<div style="display:inline-block; width:380px; position:relative;">
			日期范围：
			<input name="time" type="text" id="date-range1" class="input-text datainp" style="width:300px">
			<i class="Hui-iconfont i-close" id="inputclear">&#xe706;</i>
		</div>
		

		<span style="position:relative">
			<input type="text" name="k"  placeholder="商品名称" style="width:200px" class="input-text">
			<i class="Hui-iconfont i-close" id="inputclear">&#xe706;</i>
		</span>

		<span style="position:relative">
			<input type="text" name="uname"  placeholder="评论者名称" style="width:80px" class="input-text">
			<i class="Hui-iconfont i-close" id="inputclear">&#xe706;</i>
		</span>

		<button id="search" class="btn btn-success"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
	</span>

</nav>

<div class="mt-5 pd-15">
	<table class="table table-border table-bordered table-bg table-hover table-sort" id="categorylist">
		<thead>
			<tr class="text-c sort0">
				<th class="valueid" width="20"><input name="" type="checkbox" value=""></th>
				<th width="50" class="fun-sort2" data-name="evaluate_id" data-flag="0">ID</th>	
				<th width="150">商品名称</th>
				
				<th>意见内容</th>
				<th width="100">评论者</th>
				<th width="100">评论者头像</th>
				<th width="120" class="fun-sort2" data-name="addtime" data-flag="0">发布时间</th>	
				<th width="60">是否回复</th>
				<th width="60">显示</th>
				<th width="80">操作</th>
			</tr>
		</thead>
		<tbody id="content_sp">			
		</tbody>
	</table>


	<div class="cl pd-5 bg-1 bk-gray mt-20 mb-20"> 
		<a href="javascript:;" class="btn btn-danger l mr-10 mt-5 radius fun-all" data-type="del"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> 
		<a class="btn btn-primary radius mt-5 l mr-10" data-title="添加内容" href="javascript:;" onclick="_open('添加','evaluate-add.html','90%','80%',false)" href="javascript:;">
			<i class="Hui-iconfont">&#xe600;</i> 添加评论
		</a>
		<span class="r pt-5"  style="line-height: 35px;" id="page"></span>
		<span class="r mr-10"  style="line-height: 40px;" id="dataall"></span> 
	</div>

</div>

<!-- 模版 -->
<script id="test" type="text/html">
<% for (x in list) { %>
	<tr class="text-c va-m sort1" >
		<td class="valueid"><input name="" type="checkbox" value="<%=list[x].evaluate_id%>"></td>
		<td><%=list[x].evaluate_id%></td>
		<td class="text-l fun-search" data-name="k" data-value="<%=list[x].goods_name%>">id:<%=list[x].goods_id%> <%=list[x].goods_name%></td>	
		<td class="text-l"><%=list[x].content%></td>
		<td class="text-l fun-search" data-name="uname" data-value="<%=list[x].user_name%>"><%=list[x].user_name%></td>
		<td class="text-l" style=" cursor: pointer;">
			<img class="pic-thumb" src="/Manage/images/blank.gif" data-lazy="<%=list[x].user_avatar%>">			
		</td>
		<td><%=list[x].addtime%></td>
		<td><%if(list[x].is_reply==1){%><span class="c-red">是</span><%}else{%>否<%}%></td>		
		<td class="td-status">
			<input type="checkbox" class="switch fun-start-stop" style="outline: none;" <%if(list[x].state==1){ %>checked<% }%> />
		</td>

		<td class="td-manage f-18">
			<a style="text-decoration:none" onClick="_open('评论编辑','evaluate-add.html?editid=<%=list[x].evaluate_id%>','90%','80%',true)" class="ml-5 edit" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> 
			<a style="text-decoration:none" class="ml-5 fun-del" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i>
			<a style="text-decoration:none" class="ml-5 opencloseback" href="javascript:;" title="回复"><i class="Hui-iconfont">&#xe622;</i>
		</a>
		</td>
	</tr>
	<tr class="text-c va-m plcontent" style="display: none;">
		<td colspan="2">回复：</td>
		<td colspan="6"><textarea name="" cols="" rows="2" class="textarea" placeholder="评论回复..." style="height: 50px;"><%=list[x].reply_content%></textarea></td>
		<td colspan="2"><span class="btn btn-primary backpl" data-id="<%=list[x].evaluate_id%>">回复</span><!-- <span class="btn btn-default closeback">取消</span> --></td>
	</tr>
<% } %>
</script>
	



<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript" src="js/template-native.js"></script> 
<script type="text/javascript" src="js/s.js"></script> 

<script type="text/javascript" src="lib/daterangepicker/moment.min.js"></script> 
<script type="text/javascript" src="lib/daterangepicker/jquery.daterangepicker.js"></script>
<script type="text/javascript" src="lib/laypage/laypage.js"></script> 
<script src="/Manage/js/lazyload.min.js"></script>
<script type="text/javascript">
var API=API_ORDEREVALUATE;
var kk=API_ORDEREVALUATE;
var orderby='';
var search='';


loaddata(API,1,true);
$('#date-range1').dateRangePicker({
	startOfWeek: 'monday',
	separator : ' 至 ',
	format: 'YYYY-MM-DD HH:mm',
	autoClose: true,
	time: {
		enabled: true
	},
	defaultTime: moment().startOf('day').toDate(),
	defaultEndTime: moment().endOf('day').toDate()
});

// 关闭回复框
// $(document).on('click','span.opencloseback',function(){
// 	console.log("000")
// 	$(this).closest("tr.plcontent").toggle();
// })
$(document).on('click','.opencloseback',function(){
	$(this).closest("tr.sort1").next().toggle();
})
// 回复评论
$(document).on('click','span.backpl',function(){
	var id=$(this).data("id");
	var value=$(this).closest(".plcontent").find("textarea").val();
	var that=$(this);
    $.post(API_BACKEVALUATE,{
    	aid:id,
		reply_content:value,
    },function(data){
    	if(!checkStatus(data)) return;
    	layer.msg(data.info,{icon:1,time:1000});   
		that.closest("tr.plcontent").hide();
    	
    },'json')
})

$(document).on('click','#search',function(){
	kk=API+"?";
	var param=[
		'k='+encodeURI(document.querySelector('input[name=k]').value),

		'time='+document.querySelector('input[name=time]').value,
		'uname='+document.querySelector('input[name=uname]').value,
		
		// 'type='+document.querySelector('select[name=type]').value,
	];
	search=param.join('&');
    kk=kk+search+'&'+orderby;
	loaddata(kk,1);
})
</script>

</body>
</html>